﻿<CodeSnippets
    xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>spchol306_ex1_methods</Title>
      <Shortcut>spchol306_ex1_methods</Shortcut>
      <Description>Code snippet for Variables used in spchol306 Ex1 Methods</Description>
      <Author>Microsoft Corporation</Author>
      <SnippetTypes>
        <SnippetType>Expansion</SnippetType>
      </SnippetTypes>
    </Header>
    <Snippet>
      <Code Language="vb">
        <![CDATA[Public Sub OnRequestSucceeded(ByVal sender As Object, ByVal args As ClientRequestSucceededEventArgs)
    ' this is not called on the UI thread
    Dispatcher.BeginInvoke(New Action(AddressOf BindData))
End Sub

Public Sub BindData()
    Dim projects As List(Of Project) = New List(Of Project)()
    For Each li As ListItem In _projects
        projects.Add(New Project() With { _
                     .Title = li("Title").ToString(), _
                     .DueDate = Convert.ToDateTime(li("Due_x0020_Date").ToString()), _
                     .Description = li("Description").ToString() _
                     })
    Next
    DataGrid1.ItemsSource = projects
End Sub]]>
      </Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>
